<?php
/************************FoxPHP威客系统************************/
/*                                                            */
/*  FoxPHP.Com (C)2006-2016 FoxPHP Inc.                       */
/*  This is NOT a freeware, use is subject to license terms   */
/*  FoxPHP威客系统是商业软件,使用于商业用途请购买授权         */
/*  V3.0 2016.3                                               */
/*  foxphp@aliyun.com                                         */
/*  http://www.foxphp.com                                     */
/*                                                            */
/**************************************************************/

namespace Admin\Model;
use Think\Model;

class MemberModel extends AdminModel {
	
	//数据过滤-----------------------------------------------------------------------------------------------
	function FormatData(){
	
		$data['usertype']=intval($_POST['usertype'])>0 &&  intval($_POST['usertype'])<3 ? intval($_POST['usertype']) : 1;
		if($data['usertype']==2){
			$data['typename']='企业';
		}else{
			$data['typename']='个人';
		}
		
		$usergroup=$data['usergroup']=intval($_POST['usergroup']);
		
		$grouparray=M('AuthGroup')->token(false)->where(" id=$usergroup ")->find();
		if(!empty($grouparray)){
			$data['groupname']=$grouparray['title'];
		}

		$data['email']=I('post.email');
		
		$data['unionid']=I('post.unionid',0,'int');
		
		$data['unionname']=I('post.unionname');
 
		$data['bankcard']=I('post.bankcard');
		
		$data['qq']=I('post.qq');
		
		$data['mobile']=I('post.mobile');

		$data['SecurityForm']=I('post.SecurityForm');
		
		$password=I('post.password');
		
		if(!empty($password)){
			$member= new \Member\Model\MemberModel();
			$member->ChangePassword(intval($_POST['id']),$password);
		}
		
		return $data;
	}
	
}

?>